<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8" />
    <title>我的收藏-{eyou:global name='web_name' /}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <link href="{eyou:global name='web_cmspath'/}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    {eyou:static file="users/skin/css/eyoucms.css"/}
    <!-- 新样式 2020-11-25 -->
    {eyou:static file="users/skin/css/element/index.css" /}
    {eyou:static file="users/skin/css/e-user.css" /}
    {eyou:include file="users/skin/css/diy_css.htm"/}

    {eyou:static file="/public/static/common/js/jquery.min.js"/}
    {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
    {eyou:static file="/public/static/common/js/tag_global.js"/}
</head>

<body class="centre">
<!-- 头部 -->
{eyou:include file="users/users_header.htm" /}
<!-- END -->
<div class="breadcrumbs"></div>
<div class="ey-body-bg">
    <div class="ey-body pd0">
        <div class="ey-container w1226">
			<!-- 侧边 -->
			{eyou:include file="users/users_left.htm" /}
			<!-- END -->
			<!-- 中部 -->
			<div class="ey-con fr" >
				<div class="mi-uc-box uc-main-box mi-user-favorite">
				    <div class="uc-content-box portal-content-box">
				        <div class="uc-context">
				            <div class="box-hd">
				                <h1 class="title">我的收藏</h1>
				            </div>
				            <div class="ey-con-inside mt20">
				                <div id="finance-list_wrapper" class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%;">
				                    <table class="pay_details" cellspacing="0" cellpadding="0" style="width: 100%">
				                        <thead>
				                            <tr role="row">
				                                <th class="w40"> <div class="cell"> </div> </th>
				                                <th><div class="cell tl">文章标题</div></th>
				                                <th class="w150"><div class="cell tc">所属栏目</div></th>
				                                <th class="w80"><div class="cell tc">操作</div></th>
				                            </tr>
				                        </thead>
				                        <tbody>
				                        {empty name="$eyou.field.data"}
				                        <tr>
				                            <td  align="center" axis="col0" colspan="50">
				                                <div class="cell pt100 tc">
				                                   <span class="mb10"><img id='litpic_img'  src="{eyou:static file='users/skin/images/null-data.png' /}"/></span>
				                                 </div>
				                            </td>
				                        </tr>
				                        {else/}
				                            {eyou:volist name="$eyou.field.data" id="vo"}
				                            <tr>
				                                <td>
				                                    <div class="cell tc">
				                                        <label class="checkbox-label release-checkbox">
				                                            <span> &nbsp; </span>
				                                            <input class="checkbox" type="checkbox" name="ids[]" value="{$vo.id}">
				                                            <span class="check-mark"></span>
				                                        </label>
				                                    </div>
				                                </td>
				                                <td>
				                                    <div class="cell tl">
				                                        <a href="javascript:void(0);" data-arurl="{$vo.arcurl}" onclick="ArcUrl(this);" class="arc-name">
				                                            <div class="arc-pic">
				                                            {eyou:empty name='$vo.litpic' /}
				                                            <img src="__PUBLIC__/static/common/images/not_adv.jpg">
				                                            {eyou:else /}
				                                            <img src="{$vo.litpic}">
				                                            {/eyou:empty}
				                                            </div>
				                                            <div class="arc-title">
				                                            {$vo.title}
				                                            </div>
				                                        </a>
				                                    </div>
				                                </td>
				                                <td>
				                                    <div class="cell tc">{$vo.typename}</div>
				                                </td>
				                                <td>
				                                    <div class="cell tc">
				                                        <a href="javascript:void(0);" class="" style="margin-right: 0;" data-id='{$vo.id}' data-url="{$eyou.field.delurl}" onclick="DelData(this);">
				                                            删除
				                                        </a>
				                                    </div>
				                                </td>
				                            </tr>
				                            {/eyou:volist}
				                            <tr>
				                                <td class="border-no">
				                                    <div class="cell tc">
				                                        <label class="checkbox-label release-checkbox">
				                                            <span> &nbsp; </span>
				                                            <input class="checkbox" type="checkbox" onclick="javascript:$('input[name*=ids]').prop('checked',this.checked);">
				                                            <span class="check-mark"></span>
				                                        </label>
				                                    </div>
				                                </td>
				                                <td class="border-no">
				                                    <a class="el-button el-button--default el-button--small f14" href="javascript:void(0);" onclick="BatchDelData(this, 'ids');" data-url="{$eyou.field.delurl}">
				                                        <i class="el-icon-delete"></i> 批量删除
				                                    </a>
				                                </td>
				                                <td class="border-no"></td>
				                                <td class="border-no"></td>
				                                <td class="border-no"></td>
				                            </tr>
				                        {/empty}
				                        </tbody>
				                    </table>
				                </div>
				                {$page}
				                {eyou:if condition="!empty($pager->totalRows)"}
				                <div class="fytotal">{:sprintf(foreign_lang('page5'), $pager->totalPages, $pager->totalRows)}</div>
				                {/eyou:if}
				            </div>
				        </div>
				    </div>
				</div>
				
			<!-- END -->
			</div>

        </div>
    </div>
</div>
<script type="text/javascript">
    // 内容查看
    function ArcUrl(obj) {
        window.open($(obj).attr('data-arurl'));
    }
    // 删除单个收藏
    function DelData(obj) {
        layer.confirm(ey_foreign_users10, {
            title: false,
            btn: [ey_foreign_system5, ey_foreign_system6] //按钮
        }, function(){
            layer_loading('正在处理');
            // 确定
            $.ajax({
                type: "POST",
                url: $(obj).attr('data-url'),
                data: {del_id:$(obj).attr('data-id')},
                dataType: 'json',
                success: function (res) {
                    layer.closeAll();
                    if(res.code == 1){
                        layer.msg(res.msg, {icon: 1});
                        window.location.reload();
                    }else{
                        showErrorAlert(res.msg);
                    }
                },
                error:function(e){
                    layer.closeAll();
                    showErrorAlert(e.responseText);
                }
            });
        }, function(index){
            layer.close(index);
        });
    }
    // 批量删除收藏
    function BatchDelData(obj, name) {
        var a = [];
        $('input[name^='+name+']').each(function(i,o){
            if($(o).is(':checked')){
                a.push($(o).val());
            }
        })
        if(a.length == 0){
            showErrorAlert(ey_foreign_system7);
            return;
        }
        // 删除按钮
        layer.confirm(ey_foreign_users11, {
            title: false,
            btn: [ey_foreign_system2, ey_foreign_system3] //按钮
        }, function () {
            layer_loading('正在处理');
            $.ajax({
                type: "POST",
                url: $(obj).attr('data-url'),
                data: {del_id:a},
                dataType: 'json',
                success: function (res) {
                    layer.closeAll();
                    if(res.code == 1){
                        layer.msg(res.msg, {icon: 1});
                        window.location.reload();
                    }else{
                        showErrorAlert(res.msg);
                    }
                },
                error:function(e){
                    layer.closeAll();
                    showErrorAlert(e.responseText);
                }
            });
        }, function (index) {
            layer.closeAll(index);
        });
    }
</script>
{eyou:include file="users/users_footer.htm" /}
<!-- END -->